From: Keir Fraser Date: Thu, 10 Jan 2008 22:52:40 +0000 (+0000) Subject: x86_emulate: Certain opcodes are only valid with a memory operand. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14445^2~55 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=bf8259852fb980cc88d57cae1c1ac93f387eaa1c;p=xen.git x86_emulate: Certain opcodes are only valid with a memory operand. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/x86_emulate.c b/xen/arch/x86/x86_emulate.c index 679754c7a8..a31b5370eb 100644 --- a/xen/arch/x86/x86_emulate.c +++ b/xen/arch/x86/x86_emulate.c @@ -1751,6 +1751,8 @@ x86_emulate( case 5: /* jmp (far, absolute indirect) */ { unsigned long sel; + generate_exception_if(dst.type != OP_MEM, EXC_UD); + if ( (rc = ops->read(dst.mem.seg, dst.mem.off+dst.bytes, &sel, 2, ctxt)) ) goto done; @@ -2981,6 +2983,7 @@ x86_emulate( { unsigned long old_lo, old_hi; generate_exception_if((modrm_reg & 7) != 1, EXC_UD); + generate_exception_if(ea.type != OP_MEM, EXC_UD); if ( (rc = ops->read(ea.mem.seg, ea.mem.off+0, &old_lo, 4, ctxt)) || (rc = ops->read(ea.mem.seg, ea.mem.off+4, &old_hi, 4, ctxt)) ) goto done; @@ -3008,6 +3011,7 @@ x86_emulate( { unsigned long old, new; generate_exception_if((modrm_reg & 7) != 1, EXC_UD); + generate_exception_if(ea.type != OP_MEM, EXC_UD); if ( (rc = ops->read(ea.mem.seg, ea.mem.off, &old, 8, ctxt)) != 0 ) goto done; if ( ((uint32_t)(old>>0) != (uint32_t)_regs.eax) ||